﻿namespace RuoVea.WeighIns.Server.Models;

/// <summary>
/// 身体指标扩展表
/// </summary>
[SugarTable(nameof(InsBodyMetrics), "身体指标扩展表")]
public class InsBodyMetrics : EntityBase
{
    /// <summary>
    /// 体重记录ID
    /// </summary>
    [SugarColumn(ColumnDescription = "体重记录ID", IsNullable = false)]
    public long WeightRecordId { get; set; }

    /// <summary>
    /// 指标类型
    /// </summary>
    [Required, MaxLength(50)]
    [SugarColumn(ColumnDescription = "指标类型", Length = 50, IsNullable = false)]
    public string MetricType { get; set; } = string.Empty;

    /// <summary>
    /// 指标数值
    /// </summary>
    [SugarColumn(ColumnDescription = "指标数值", IsNullable = false)]
    public double MetricValue { get; set; }

    /// <summary>
    /// 指标单位
    /// </summary>
    [MaxLength(20)]
    [SugarColumn(ColumnDescription = "指标单位", Length = 20, IsNullable = true)]
    public string? MetricUnit { get; set; }

    /// <summary>
    /// 体重记录（导航属性）
    /// </summary>
    [Navigate(NavigateType.ManyToOne, nameof(WeightRecordId))]
    public InsWeighInfo? WeightRecord { get; set; }
}

